﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
using TinyERP.Framework.Controls;
using TinyERP.Framework;


namespace TinyERPApp
{
    public class About : KryptonForm
    {
     
        public About()
        {
            InitializeComponent();
        }
        private KButton btnOK;
        private KRichTextBox txtDescription;
        private KLabel lblVersion;
        private KLabel lblVersionValue;
       
        
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.lblVersionValue = new TinyERP.Framework.Controls.KLabel();
            this.lblVersion = new TinyERP.Framework.Controls.KLabel();
            this.txtDescription = new TinyERP.Framework.Controls.KRichTextBox();
            this.btnOK = new TinyERP.Framework.Controls.KButton();
            this.SuspendLayout();
            // 
            // lblVersionValue
            // 
            this.lblVersionValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblVersionValue.ForeColor = System.Drawing.SystemColors.HotTrack;
            this.lblVersionValue.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblVersionValue.Location = new System.Drawing.Point(69, 9);
            this.lblVersionValue.Name = "lblVersionValue";
            this.lblVersionValue.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblVersionValue.ResourceKey = null;
            this.lblVersionValue.ResourceModuleKey = null;
            this.lblVersionValue.Size = new System.Drawing.Size(51, 20);
            this.lblVersionValue.TabIndex = 4;
            this.lblVersionValue.Text = "Version";
            this.lblVersionValue.Values.ExtraText = "";
            this.lblVersionValue.Values.Image = null;
            this.lblVersionValue.Values.Text = "Version";
            // 
            // lblVersion
            // 
            this.lblVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblVersion.LabelStyle = ComponentFactory.Krypton.Toolkit.LabelStyle.NormalControl;
            this.lblVersion.Location = new System.Drawing.Point(12, 9);
            this.lblVersion.Name = "lblVersion";
            this.lblVersion.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.lblVersion.ResourceKey = null;
            this.lblVersion.ResourceModuleKey = null;
            this.lblVersion.Size = new System.Drawing.Size(51, 20);
            this.lblVersion.TabIndex = 3;
            this.lblVersion.Text = "Version";
            this.lblVersion.Values.ExtraText = "";
            this.lblVersion.Values.Image = null;
            this.lblVersion.Values.Text = "Version";
            // 
            // txtDescription
            // 
            this.txtDescription.InputControlStyle = ComponentFactory.Krypton.Toolkit.InputControlStyle.Standalone;
            this.txtDescription.Location = new System.Drawing.Point(15, 42);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.txtDescription.ReadOnly = true;
            this.txtDescription.Size = new System.Drawing.Size(510, 313);
            this.txtDescription.TabIndex = 2;
            // 
            // btnOK
            // 
            this.btnOK.AutoSize = true;
            this.btnOK.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.btnOK.ButtonStyle = ComponentFactory.Krypton.Toolkit.ButtonStyle.Standalone;
            this.btnOK.Image = null;
            this.btnOK.Location = new System.Drawing.Point(243, 371);
            this.btnOK.Name = "btnOK";
            this.btnOK.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.Global;
            this.btnOK.ResourceKey = null;
            this.btnOK.ResourceModuleKey = null;
            this.btnOK.Size = new System.Drawing.Size(40, 24);
            this.btnOK.TabIndex = 1;
            this.btnOK.Text = "Close";
            this.btnOK.Values.ExtraText = "Close";
            this.btnOK.Values.Image = null;
            this.btnOK.Values.ImageStates.ImageCheckedNormal = null;
            this.btnOK.Values.ImageStates.ImageCheckedPressed = null;
            this.btnOK.Values.ImageStates.ImageCheckedTracking = null;
            this.btnOK.Values.Text = "";
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            // 
            // About
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(537, 402);
            this.Controls.Add(this.lblVersionValue);
            this.Controls.Add(this.lblVersion);
            this.Controls.Add(this.txtDescription);
            this.Controls.Add(this.btnOK);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.Name = "About";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "About";
            this.Load += new System.EventHandler(this.AboutFormLoad);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private void AboutFormLoad(object sender, EventArgs e)
        {
            this.lblVersionValue.Text = ApplicationInfo.VersionNumber;
            
            StringBuilder sb = new StringBuilder();
            sb.Append(ApplicationInfo.Description + "\r\n");
            sb.Append("-----------------------------------------------\r\n");
            sb.Append("Update features and bug fixed\r\n");
            sb.Append(ApplicationInfo.LongDescription);
            sb.Append("\r\n");
            sb.Append("-----------------------------------------------\r\n");
            sb.Append("Team\r\n");
            foreach (DeveloperInfo developer in ApplicationInfo.Developers)
            {
                
                sb.Append(developer.Name + "\r\n");
                sb.Append("Email: " + developer.Email + "\r\n");
                sb.Append("Home page: " + developer.HomePage + "\r\n");
                sb.Append("-----------------------------------------------\r\n");
            }
            this.txtDescription.Text = sb.ToString();
            
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            this.Close();
        }

       
    }
}
